﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Nirvana.UI
{
    public class LoadingWaitWindow : UIWindowBase
    {
        private float rotationSpeed = -3f;
        public Transform img;

        public override void OnOpen()
        {
            base.OnOpen();
            m_canvas.overrideSorting = true;
            m_canvas.sortingOrder = 10000;


        }

        private void OnEnable()
        {
            Updater.AddUpdate("LoadingWait", OnUpdate, true);
        }
        private void OnDisable()
        {
            Updater.RemoveUpdate("LoadingWait", OnUpdate);
        }
        private void OnUpdate(float delat)
        {
            if (img != null)
            {
                img.Rotate(new Vector3(0, 0, rotationSpeed));
            }
        }


    }
}
